# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libnetfilter_cthelper
pkgver=1.0.0
pkgrel=0
pkgdesc="A Netfilter netlink library for connection tracking helpers"
url="http://www.netfilter.org/projects/libnetfilter_cthelper/index.html"
arch="all"
license="GPL-2.0"
depends=""
makedepends="linux-headers libmnl-dev"
install=""
subpackages="$pkgname-dev"
source="https://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-$pkgver.tar.bz2"

_builddir="$srcdir"/libnetfilter_cthelper-$pkgver
prepare() {
	local i
	cd "$_builddir"
	update_config_sub || return 1
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
}

sha512sums="f0372daee0edbf4c27ee80eadd4ce786a4b67b39c0b9d22e88bc9adcbdffd6676eb9df01b933ee64d2fcea9c05a9ca9070c94e907277d69acbd22ae9a3c74e45  libnetfilter_cthelper-1.0.0.tar.bz2"
